<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>基本信息</title>
    <%@include file="/WEB-INF/pages/common/taglib.jsp" %>
    <%@include file="/WEB-INF/pages/common/common.jsp" %>
    <style>
        .table3 tr {
            height: 40px;
            line-height: 40px;
            border: 1px #ccc solid
        }
    </style>
</head>
<body style="overflow-x: hidden">
<form id="detailForm">
    <div class="content content_frame">
        <h4 class="mainTitle"><img src="${basePath}/images/icon3.png"/>报核状态:
        <span style="cursor: pointer"
              id="sendStatusC">${empty baseInfo.sendStatusDisplay ? '暂无' : baseInfo.sendStatusDisplay}</span>
        </h4>
        <br/>
        <ul class="contentNav dib-wrap">
            <li class="dib">
                <a onclick="javascript:history.go(-1)">
                    <i class='fa fa-reply'></i>&nbsp;&nbsp;返&nbsp;回 </a>
            </li>
        </ul>
        <br/>

        <table class="table3">
            <tr>
                <th colspan="4">基本信息</th>
            </tr>
            <tr>
                <td width="15%">手册编号</td>
                <td width="35%">
                    <label><input type="text" name="eBillingNo"
                                  value="${baseInfo.eBillingNo}"></label>
                </td>
                <td width="15%">企业内部编码</td>
                <td width="35%">
                    <label><input type="text" name="entEBillingNo"
                                  value="${baseInfo.entEBillingNo}"></label>
                </td>
            </tr>
            <tr>
                <td width="15%">经营单位</td>
                <td width="35%">
                    <label><input type="text" name="enterpriseName"
                                  value="${baseInfo.enterpriseName}"></label>
                </td>
                <td width="15%">报核类型</td>
                <td width="35%">
                    <label><input type="text" name="decType"
                                  value="电子手册正式报核" readonly="readonly"></label>
                </td>
            </tr>
            <tr>
                <td width="15%">进口总金额</td>
                <td width="35%">
                    <label><input type="text" name="importTotalValue"
                                  value="${baseInfo.importTotalValue}"></label>
                </td>
                <td width="15%">出口总金额</td>
                <td width="35%">
                    <label><input type="text" name="exportTotalValue"
                                  value="${baseInfo.exportTotalValue}"></label>
                </td>
            </tr>
            <tr>
                <td width="15%">进口报关单份数</td>
                <td width="35%">
                    <label><input type="text" name="importTotalDeclareNum"
                                  value="${baseInfo.importTotalDeclareNum}"></label>
                </td>
                <td width="15%">出口报关单份数</td>
                <td width="35%">
                    <label><input type="text" name="exportTotalDeclareNum"
                                  value="${baseInfo.exportTotalDeclareNum}"></label>
                </td>
            </tr>
            <tr>
                <td width="15%">报核料件份数</td>
                <td width="35%">
                    <label><input type="text" name="cancelMaterialsNum"
                                  value="${baseInfo.cancelMaterialsNum}"></label>
                </td>
                <td width="15%">报核成品项数</td>
                <td width="35%">
                    <label><input type="text" name="cancelEndgoodNum"
                                  value="${baseInfo.cancelEndgoodNum}"></label>
                </td>
            </tr>
            <tr>
                <td width="15%">申报日期</td>
                <td width="35%">
                    <label><input type="text" name="declDate"
                                  value="${baseInfo.declDate}" class="Wdate"
                                  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"></label>
                </td>
                <td width="15%">录入员代码</td>
                <td width="35%">
                    <label><input type="text" name="createOperId"
                                  value="${baseInfo.createOperId}"></label>
                </td>
            </tr>
        </table>
        <br/>
        <table class="table3" style="margin-bottom: 2px">
            <tr>
                <th colspan="4">报关单信息</th>
            </tr>
        </table>
        <table id="declareList" style="height: 1px">
        </table>
        <br/>
        <table class="table3" style="margin-bottom: 2px">
            <tr>
                <th colspan="4">成品信息</th>
            </tr>
        </table>
        <table id="endgoodList" style="height: 1px">
        </table>
        <br/>
        <table class="table3" style="margin-bottom: 2px">
            <tr>
                <th colspan="4">料件信息</th>
            </tr>
        </table>
        <table id="materialsList" style="height: 1px">
        </table>
        <br/>
        <table class="table3" style="margin-bottom: 2px">
            <tr>
                <th colspan="4">单损耗信息</th>
            </tr>
        </table>
        <table id="consumptionList" style="height: 1px">
        </table>
        <br/>
    </div>
</form>
<script type="text/javascript">
    function ieFlag(cellvalue, options, rowObject) {
        return $._options._dictName($.trim(cellvalue || ''), {"I": "进口", "E": "出口"});
    }

    $(function () {
        $("input").addClass("input1");
        $(".table3 td:even").css("background-color", "#f5f5f5");

        $("#declareList").jqGrid({
            datatype: "jsonstring",
            datastr: '${declareListJSON}',
            colNames: ['报关单号', '申报地海关', '进出口标志', '申报日期', '进出口日期', '核扣方式'],
            colModel: [
                {name: 'declNo', index: 'declNo', width: 40},
                {name: 'declCustomId', index: 'declCustomId', width: 100},
                {name: 'ieFlag', index: 'ieFlag', width: 100, formatter: ieFlag},
                {name: 'declDate', index: 'declDate', width: 100},
                {name: 'ieDate', index: 'ieDate', width: 100},
                {name: 'verifyMode', index: 'verifyMode', width: 100}
            ],
//            caption: "报关单列表",
            viewrecords: true, // show the current page, data rang and total records on the toolbar
            height: 'auto',
            autowidth: true,
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });

        $("#endgoodList").jqGrid({
            datatype: "jsonstring",
            datastr: '${endgoodListJSON}',
            colNames: ['序号', '商品编码', '附加号', '商品名称', '计量单位', '出口总数量', '深加工结转出口数量', '产品放弃数量',
                '成品退换进口数量', '产品退换出口数量', '企业库存量'],
            colModel: [
                {name: 'seqNo', index: 'seqNo', width: 40},
                {name: 'goodsNo', index: 'goodsNo', width: 100},
                {name: 'addNo', index: 'addNo', width: 100},
                {name: 'goodsName', index: 'goodsName', width: 100},
                {name: 'unitDisplay', index: 'unitDisplay', width: 100},
                {name: 'exportTotalQty', index: 'exportTotalQty', width: 100},
                {name: 'exportDeepProcessQty', index: 'exportDeepProcessQty', width: 100},
                {name: 'prodAbandonQty', index: 'prodAbandonQty', width: 100},
                {name: 'prodReturnImportQty', index: 'prodReturnImportQty', width: 100},
                {name: 'prodReturnExportQty', index: 'prodReturnExportQty', width: 100},
                {name: 'entStockQty', index: 'entStockQty', width: 100}
            ],
//            caption: "成品列表",
            viewrecords: true, // show the current page, data rang and total records on the toolbar
            height: 'auto',
            autowidth: true,
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });

        $("#materialsList").jqGrid({
            datatype: "jsonstring",
            datastr: '${materialsListJSON}',
            colNames: ['序号', '商品编码', '附加号', '商品名称', '计量单位', '进口总数量', '深加工结转进口数量',
                '产品总耗用量', '内销数量', '复出数量', '料件放弃数量', '边角料数量', '余料结转数量', '料件剩余数量', '企业库存数'],
            colModel: [
                {name: 'seqNo', index: 'seqNo', width: 40},
                {name: 'goodsNo', index: 'goodsNo'},
                {name: 'addNo', index: 'addNo'},
                {name: 'goodsName', index: 'goodsName'},
                {name: 'unitDisplay', index: 'unitDisplay'},
                {name: 'importQty', index: 'importQty'},
                {name: 'importDeepProcessQty', index: 'importDeepProcessQty'},
                {name: 'prodUseQty', index: 'prodUseQty'},
                {name: 'domesticSaleQty', index: 'domesticSaleQty'},
                {name: 'comebackQty', index: 'comebackQty'},
                {name: 'abandonQty', index: 'abandonQty'},
                {name: 'scrapQty', index: 'scrapQty'},
                {name: 'leftCarryoverQty', index: 'leftCarryoverQty'},
                {name: 'leftQty', index: 'leftQty'},
                {name: 'entStockQty', index: 'entStockQty'}
            ],
//            caption: "料件列表",
            viewrecords: true, // show the current page, data rang and total records on the toolbar
            height: 'auto',
            autowidth: true,
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });

        $("#consumptionList").jqGrid({
            datatype: "jsonstring",
            datastr: '${consumptionListJSON}',
            colNames: ['序号', '成品名称', '料件序号', '料件名称', '处理标志', '单耗/净耗', '损耗率%', '非保税料件比例%'],
            colModel: [
                {name: 'seqNo', index: 'seqNo', width: 40},
                {name: 'goodName', index: 'goodName'},
                {name: 'materialsNo', index: 'materialsNo'},
                {name: 'materialsName', index: 'materialsName'},
                {name: 'dealFlag', index: 'dealFlag'},
                {name: 'netWaste', index: 'netWaste'},
                {name: 'wasteRate', index: 'wasteRate'},
                {name: 'unTaxMaterialsPercent', index: 'unTaxMaterialsPercent'}
            ],
//            caption: "单损耗列表",
            viewrecords: true, // show the current page, data rang and total records on the toolbar
            height: 'auto',
            autowidth: true,
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });

        $(window).resize(function () {
            $("#declareList,#endgoodList,#materialsList,#consumptionList").setGridWidth($(window).width() - 30);
        });

        $("#declareList,#endgoodList,#materialsList,#consumptionList").setGridWidth($(window).width() - 30);
        formValidate("detailForm", {
            eBillingNo: {
                required: true
            }, entEBillingNo: {
                required: true
            }, enterpriseName: {
                required: true
            }, decType: {
                required: true
            }, importTotalValue: {
                required: true
            }, exportTotalValue: {
                required: true
            }, importTotalDeclareNum: {
                required: true
            }, exportTotalDeclareNum: {
                required: true
            }
        });

        $("#detailForm input,textarea").attr("disabled", true);

    });


</script>
</body>
</html>
